package be.phl.obstacleapp;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import be.phl.layoutAdapter.ItemProblemColumnAdapter;
import com.devsmart.android.ui.HorizontalListView;

public class TreeViewFragment extends Fragment {

	private static final String TAG = "TreeViewFragment";

	/**
	 * key for arguments
	 */
	public static final String ARG_SCREENINGITEM_ID = "ScreeningItemId";

	/**
	 * List with the roomitems
	 */
	private static int ScreeningItemId;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

		ScreeningItemId = getArguments().getInt(ARG_SCREENINGITEM_ID);
		Log.i(TAG, "ScreeningItemId: " + ScreeningItemId);

		final HorizontalListView listview = (HorizontalListView) getActivity()
				.findViewById(R.id.listview);

		final ItemProblemColumnAdapter adapter = new ItemProblemColumnAdapter(
				getActivity(), ScreeningItemId);
		listview.setAdapter(adapter);

	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.fragment_treeview, container,
				false);

		return rootView;

	}
}
